package com.yb.personelmanagement.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yb.personelmanagement.controller.jwt.AuthenticationException;
import com.yb.personelmanagement.domain.System.Result;
import com.yb.personelmanagement.domain.System.StatusCode;

@ControllerAdvice
public class BaseExceptionHandler {
@ExceptionHandler(value = AuthenticationException.class)
@ResponseBody
public Result error( AuthenticationException e) {
//e.printStackTrace();
return new Result(false, e.getToken(), e.getMessage(),StatusCode.ERROR);
}
}